﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 第六次作业
{
    public partial class Form2 : Form
    {
        public Dictionary<string, string> data = new Dictionary<string, string>();
        public Form2(Dictionary<string,string> keyValuePairs)
        {
            data = keyValuePairs;
            InitializeComponent();
        }

        public void Table()
        {
            dataGridView1.Rows.Clear();
            string[] time, kinds;
            time = data.Keys.ToArray();
            kinds = data.Values.ToArray();
            for(int i = 0; i < data.Count; i++)
            {
                string[] str = { time[i], kinds[i] };
                dataGridView1.Rows.Add(str);
            }
                
        }

        private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Table();
        }
    }
}
